#include <cstdio>

#include "captureRegionInfo.h"

bool captureRegionInfo_loadFromFile(double arCalibratedMarkerMatrices[4][3][4], int * cubeRadius, unsigned char * treshold, char * fileName) {
	FILE * f;
	int i = 0;
	double m1, m2, m3, m4;

	f = fopen("platform.ini", "rt");
	if (f) {
		for (i = 0; i < 12; i++) {
			if (fscanf(f, "%lf %lf %lf %lf", &m1, &m2, &m3, &m4) == 4) {
				arCalibratedMarkerMatrices[i / 3][i % 3][0] = m1;
				arCalibratedMarkerMatrices[i / 3][i % 3][1] = m2;
				arCalibratedMarkerMatrices[i / 3][i % 3][2] = m3;
				arCalibratedMarkerMatrices[i / 3][i % 3][3] = m4;
			} else {
				break;
			}
		}
		fclose(f);
		*treshold = 127;
	}
	return i == 12;
}